<?php

namespace app\middleware;


use app\Request;

/**
 * 全局中间件 数据统一管理
 * @package app\middleware
 * User: liuhongbin
 * Date: 2021-09-22 11:19
 */
class DkMiddleware
{
    /**
     * @param Request $request
     * @param \Closure $next
     * @return mixed
     */
    public function handle(Request $request, \Closure $next)
    {
        $request->global = [
            'access-token' => $request->header('access-token'),
            'addon-name'   => $request->header('addon-name'),
            'plaid'        => $request->header('plaid'),
        ];
        $response = $next($request);
        return $response;
    }
}
